import request from '@/utils/request'

// 查询智能锁设备信息列表
export function listSmartlocks(query) {
  return request({
    url: '/lock/smartlocks/list',
    method: 'get',
    params: query
  })
}

// 查询智能锁设备信息列表
export function listSmartlocks1(query) {
  return request({
    url: '/lock/smartlocks/list1',
    method: 'get',
    params: query
  })
}

// 查询智能锁设备信息详细
export function getSmartlocks(id) {
  return request({
    url: '/lock/smartlocks/' + id,
    method: 'get'
  })
}

// 新增智能锁设备信息
export function addSmartlocks(data) {
  return request({
    url: '/lock/smartlocks',
    method: 'post',
    data: data
  })
}

// 修改智能锁设备信息
export function updateSmartlocks(data) {
  return request({
    url: '/lock/smartlocks',
    method: 'put',
    data: data
  })
}

// 修改智能锁设备信息
export function updateSmartlocksByMac(data) {
  return request({
    url: '/lock/smartlocks/updateSmartlocksByMac',
    method: 'put',
    data: data
  })
}

// 删除智能锁设备信息
export function delSmartlocks(id) {
  return request({
    url: '/lock/smartlocks/' + id,
    method: 'delete'
  })
}

//查询智能锁状态数量
export function getLockCount() {
  return request({
    url: '/lock/smartlocks/getASmatlockCount',
    method: 'get'
  })
}

//查询闲置、在住等数量
export function listCount() {
  return request({
    url: '/lock/smartlocks/listCount',
    method: 'get'
  })
}
//查询闲置
export function listCountXianZhi() {
  return request({
    url: '/lock/smartlocks/listCountXianZhi',
    method: 'get'
  })
}
